package com.shop.product.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author：作者姓名
 * @Package：com.shop.product.config
 * @Project：RuoYi-Cloudnew
 * @name：ExecutorThreadConfig
 * @Date：2024/6/6 9:54
 */
@Component
@Configuration
public class ExecutorThreadConfig {
    @Bean
    public ThreadPoolExecutor itemInfo(){
        return new ThreadPoolExecutor(
                1,
                20,
                1000*60,
                TimeUnit.MILLISECONDS,
                new LinkedBlockingDeque<>(2000),
                Executors.defaultThreadFactory()
        );
    }
}
